home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Tie::Handle.Z / Tie::Handle
Encoding:
Text File  |  1998-10-28  |  3.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))  22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))    TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       Tie::Handle -    base class definitions for tied    handles
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           package NewHandle;
  13.           require Tie::Handle;
  14.  
  15.           @ISA = (Tie::Handle);
  16.  
  17.           sub READ { ... }          # Provide a needed method
  18.           sub TIEHANDLE { ... }      # Overrides inherited    method
  19.  
  20.  
  21.           package main;
  22.  
  23.           tie *FH, 'NewHandle';
  24.  
  25.  
  26.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  27.       This module provides some skeletal methods for handle-tying
  28.       classes. See the _p_e_r_l_t_i_e manpage for a list of the functions
  29.       required in tying a handle to    a package.  The    basic
  30.       TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee package provides a new method, as    well as
  31.       methods TIESCALAR, FETCH and STORE. The new method is
  32.       provided as a    means of grandfathering, for classes that
  33.       forget to provide their own TIESCALAR    method.
  34.  
  35.       For developers wishing to write their    own tied-handle
  36.       classes, the methods are summarized below. The the _p_e_r_l_t_i_e
  37.       manpage section not only documents these, but    has sample
  38.       code as well:
  39.  
  40.       TIEHANDLE classname, LIST
  41.            The method invoked by the command tie *glob, classname.
  42.            Associates a new    glob instance with the specified
  43.            class. LIST would represent additional arguments    (along
  44.            the lines of the    _A_n_y_D_B_M__F_i_l_e manpage and    compatriots)
  45.            needed to complete the association.
  46.  
  47.       WRITE    this, scalar, length, offset
  48.            Write _l_e_n_g_t_h bytes of data from _s_c_a_l_a_r starting at
  49.            _o_f_f_s_e_t.
  50.  
  51.       PRINT    this, LIST
  52.            Print the values    in _L_I_S_T
  53.  
  54.       PRINTF this, format, LIST
  55.            Print the values    in _L_I_S_T    using _f_o_r_m_a_t
  56.  
  57.       READ this, scalar, length, offset
  58.            Read _l_e_n_g_t_h bytes of data into _s_c_a_l_a_r starting at
  59.            _o_f_f_s_e_t.
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))  22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))    TTTTiiiieeee::::::::HHHHaaaannnnddddlllleeee((((3333))))
  71.  
  72.  
  73.  
  74.       READLINE this
  75.            Read a single line
  76.  
  77.       GETC this
  78.            Get a single character
  79.  
  80.       DESTROY this
  81.            Free the    storage    associated with    the tied handle
  82.            referenced by _t_h_i_s.  This is rarely needed, as Perl
  83.            manages its memory quite    well. But the option exists,
  84.            should a    class wish to perform specific actions upon
  85.            the destruction of an instance.
  86.  
  87.      MMMMOOOORRRREEEE IIIINNNNFFFFOOOORRRRMMMMAAAATTTTIIIIOOOONNNN
  88.       The the _p_e_r_l_t_i_e manpage section contains an example of tying
  89.       handles.
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.